import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'

export const menuSlice = createSlice({
	name: 'menu',
	initialState: {
		storageMenuList: [],
		tagList: [
            {
                title: '首页',
                path: '/index'
            }
        ],
	},
	reducers: {
		// 暂存路由
		setStorageMenuList(state, { payload }) {
			state.storageMenuList = payload
		},
		// 标签路由
		setTagList(state, { payload }) {
			// console.log('payload -----', payload)
			state.tagList = payload
		},
	},
})

export const { setStorageMenuList, setTagList } = menuSlice.actions

export default menuSlice.reducer
